package com.homework;

/**
 * @author xiyu
 * @version 1.0
 * @date 2025/3/27 20:01
 * @description
 */
public class T8 {
    public static void main(String[] args) {
        String str = "nbaernbatynbauinbaopnba";
        String str1 = "nba";
        String indexs = "";

        int count=0;
        int temp = 0;
        while (true) {
            int index1 = str.indexOf(str1);
            temp = temp+index1+str1.length();

            indexs = indexs + (temp-str1.length())+" ";
            str = str.substring(index1+str1.length());
            count++;
//            System.out.println(str);
            if (str.length()==0){
                System.out.println("indexs = " + indexs);
                System.out.println("count = " + count);
                break;
            }

        }
    }
}
